<?php
header('Content-type:text/html;charset=utf-8');
// 获取前端数据
$usernmae = $_POST['username'];
$userposs = $_POST['userposs'];
// 连接数据库
$conn = mysqli_connect('localhost','root','root','xiaomi');
if($conn){
    // 插入
    $sql = 'insert into login(username,userpass) value("'.$username.'","'.$userpass.'")';
    $result = mysqli_query($conn,$sql);
}else{
    echo '连接失败';
};
if($result){
    echo '1';
}else{
    echo '0';
}
?>